php forum
php mysql forum
php mysql smarty
 
Topic Options
#318145 - 08/23/09 02:34 PM [7.x] Google Adsense Search
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
VNC Web Design UBB.Google Adsense Search by Gizmo (James at VNC Web Design; http://www.virtualnightclub.net/)
This addon allows your users to search Google and have the results display inline on your forum.

Homepage: http://www.virtualnightclub.net/detail/4/ubb-gsearch.php
Support: http://www.ubbdev.com/forums/ubbthreads.php/topics/318145/7_x_Google_Adsense_Search.html

Install Instructions:
Upload the included files to your server (be careful to preserve directory structure) and add a link
to the header.inc.php template file.


Setup:
Be sure to edit the language file (languages/english/google.php), this file contains the configuration options for this script; including your publisher ID which contains your style code ID. This is a requirement as it includes your URL, Publisher ID, Style ID; basicaly everything this script needs.

There is an "advanced" tick in the Script file (/scripts/google.inc.php), basically just affecting how the title is built; for most users this won't need to be adjusted.


Mods:
To add an option in your header:
In /templates/default/header.tpl Find:
Code:
<a href="{ubb url="ubb=faq"}">{$lang.FAQ_TEXT}</a>


Add ABOVE:
Code:
<a href="{ubb url="ubb=google"}">{$lang.GOOGLE}</a> &nbsp;&nbsp;&nbsp;


In /languages/english/generic.php Find:
Code:
$ubbt_lang['FAQ_TEXT'] = "FAQ";


Add AFTER:
Code:
$ubbt_lang['GOOGLE'] = "Google";



To have "Using the Google Search" display on the Who's Online:
In /languages/english/online.php Add:
Code:
$ubbt_lang['GOOGLE'] = "Using the Google Search";


Files:
/languages/english/google.php
/scripts/google.inc.php
/templates/default/google.tpl


Attachments
UBB.Google Adsense Search.zip (4 downloads)

_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318146 - 08/23/09 03:04 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Extended the instructions with possible modifications people will request ("How do I add to the Who's Online Page?" and "How do I add to my Header?")
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318148 - 08/23/09 03:20 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
trying it out now!

what would it take to add it to the search drop down menu?

and this still doesn't resolve my original problem, redirecting a google search from another page and having the output in the wrapper..

I have custom error pages, so when someone gets an error 404, they get a window offering them helpful advice, like site navigation, and a search box.. that search box currently has to point to a standalone page to display googles results, I can't get in the wrapper...

Top
#318149 - 08/23/09 03:32 PM Re: [7.x] Google Adsense Search [Re: badfrog]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
ok, I just removed the google search box from my 404 page and put a link in its place to the the google mod..
not as fancy, but should work just as well.

Top
#318150 - 08/23/09 03:50 PM Re: [7.x] Google Adsense Search [Re: badfrog]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Adding it to the search dropdown shouldn't be difficult at all, simply open the header.tpl file and then locate the search dropdown code:
Code:
{if $search_link}
<div id="search_popup" style="display: none">
	<form method="post" action="{ubb url=""}">
		<input type="hidden" name="ubb" value="dosearch" />
		<input type="hidden" name="daterange" value="0" />
		<input type="hidden" name="where" value="bodysub" />
		<input type="hidden" name="fromsearch" value="1" />
		<input type="hidden" name="checkwords" value="1" />

		<table class="popup_menu">
			<tr>
				<td nowrap='nowrap' class="popup_menu_header">{$lang.SEARCH_HEADER}</td>
			</tr>
			<tr>
				<td class="popup_menu_content noclose">
					<label>
						<input type="text" name="Words" class="form-input" />
						<input type="submit" name="textsearch" value="{$lang.GO_BUTTON}" class="form-button" />
					</label>
				</td>
			</tr>
			<tr>
				<td class="popup_menu_content"><a href="{ubb url="ubb=search"}">{$lang.ADVANCED_BUTTON}</a></td>
			</tr>
		</table>
	</form>
</div>
<script type="text/javascript">
	registerPopup("search_popup");
</script>
{/if}


Then, add a new line after:
Code:
			<tr>
				<td class="popup_menu_content"><a href="{ubb url="ubb=search"}">{$lang.ADVANCED_BUTTON}</a></td>
			</tr>


Like:
Code:
			<tr>
				<td class="popup_menu_content"><a href="{ubb url="ubb=google"}">Google Search</a></td>
			</tr>
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318151 - 08/23/09 03:52 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
As for your 404 stuff, theres an additional parameter you have to pass (it makes it so the search result stuff only shows when a search is being preformed); so you'd put:

Code:
<form action="/forum/ubbthreads.php" id="cse-search-box">
	<input type="hidden" name="ubb" value="google" />
	<input type="hidden" name="process" value="1" />
	<input type="hidden" name="cx" value="partner-pub-5168900358893374:runafbk50ac" />
	<input type="hidden" name="cof" value="FORID:11" />
	<input type="hidden" name="ie" value="UTF-8" />
	<input type="text" name="q" size="31" class="form-input" /> 
	<input type="submit" name="sa" value="Search" class="form-button" />
</form>
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318152 - 08/23/09 05:06 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
it parses, brings up the mod on the site, but I get..
Code:
Google   	 
Error
 

    Not Found
    The requested URL /cse?ubb=google&process=1&cx=partner-partner-pub-1428978494316705%3Ayix18h-jgii&cof=FORID%3A11&ie=UTF-8&q=test&sa=Search&ad=w9&num=10&rurl=http%3A%2F%2Fwww.vannin.com%2Fthreads%2Fubbthreads.php%3Fubb%3Dgoogle%26process%3D1%26cx%3Dpartner-partner-pub-1428978494316705%253Ayix18h-jgii%26cof%3DFORID%253A11%26ie%3DUTF-8%26q%3Dtest%26sa%3DSearch was not found on this server. 

Top
#318153 - 08/23/09 05:24 PM Re: [7.x] Google Adsense Search [Re: badfrog]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Odd URL... Could you link me to a page that's returning that as a result so i can check it out?
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318154 - 08/23/09 05:49 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
just trigger a 404 error on my site...



Edited by badfrog (08/30/09 06:54 AM)
Edit Reason: removed link so SLURP would stop following it

Top
#318155 - 08/23/09 06:18 PM Re: [7.x] Google Adsense Search [Re: badfrog]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Wow, thats interesting lol... I'll take a look later on tonight (working on another mod :ahem:)
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318157 - 08/23/09 06:40 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
another mod? what could that be?! lol

fixing this now is more of a curiosity for me than a necessity.

having the text input box on the 404 page looks better to me.. personal preference I guess.

for now I can just use a link to the the embedded search page since I know that works.

Top
#318158 - 08/23/09 06:49 PM Re: [7.x] Google Adsense Search [Re: badfrog]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
well, the 404 is on google's site; it doesn't like how they pull the fake url into the mix and that's what it's choking on.

I finished v1 of the nag screns.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#318159 - 08/23/09 07:18 PM Re: [7.x] Google Adsense Search [Re: Gizmo]
badfrog Offline
Power User

Registered: 03/05/07
Posts: 83
Loc: somewhere on the coast of Main...
thanx for the work on the nag screens, will test it out a little later.

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks